package com.yys.huarongdao.fragment;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.yys.huarongdao.R;

@SuppressLint("ValidFragment")
public class RankingListFragment extends Fragment {
    private BaseAdapter adapter;
    private String title;

    public RankingListFragment(BaseAdapter adapter,String title) {
        this.adapter=adapter;
        this.title=title;
    }

    public RankingListFragment() {
        super();
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view =inflater.inflate(R.layout.fragment_ranking_list,container,false);
        TextView title=view.findViewById(R.id.frament_ranking_list_title);
        title.setText(this.title);

        ListView listView=view.findViewById(R.id.list_container_ranking);
        View headView = inflater.inflate(R.layout.list_header_ranking, null, false);
        listView.addHeaderView(headView);
        listView.setAdapter(adapter);
        return view;
    }
}
